<?php
include_once("../../untils/conn.php");

$tx_appid = $_POST['tx_appid'];
$tx_appkey = $_POST['tx_appkey'];
$al_appid = $_POST['al_appid'];
$al_key = $_POST['al_key'];
$auto = $_POST['auto'];

// echo "tx_appid: " . $tx_appid . "<br>";
// echo "tx_appkey: " . $tx_appkey . "<br>";
// echo "al_appid: " . $al_appid . "<br>";
// echo "al_key: " . $al_key . "<br>";
// echo "auto: " . $auto . "<br>";
echo "<script>alert('暂不支持该修改操作！！！'); window.history.back();</script>";
exit;
// 更新腾讯相关字段
if (!empty($tx_appid) || !empty($tx_appkey)) {
    $query = "UPDATE system SET appid='$tx_appid', appkey='$tx_appkey' WHERE type='tencent'";
    $result = mysqli_query($con, $query);
    if (!$result) {
        // 更新失败
        echo "<script>alert('更新腾讯云信息失败'); window.history.back();</script>";
        exit;
    }
}

// 更新阿里云相关字段
if (!empty($al_appid) || !empty($al_key)) {
    $query = "UPDATE system SET appid='$al_appid', appkey='$al_key' WHERE type='aliyun'";
    $result = mysqli_query($con, $query);
    if (!$result) {
        // 更新失败
        echo "<script>alert('更新阿里云信息失败'); window.history.back();</script>";
        exit;
    }
}

// 更新系统字段
if (!empty($auto)) {
    $query = "UPDATE system SET auto='$auto' WHERE type='xitong'";
    $result = mysqli_query($con, $query);
    if (!$result) {
        // 更新失败
        echo "<script>alert('更新系统信息失败'); window.history.back();</script>";
        exit;
    }
}

// 更新成功
echo "<script>alert('操作成功'); window.history.back();</script>";
exit;
?>
